package common;

import android.util.Log;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Peter on 10. 8. 2014.
 */
public class DateHelper {

    private static final String LOG="DateHelper";


    public static String getDate(Date date){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String d=sdf.format(date);
        return  d;
    }


    public static Date getDate(String date){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Date d= null;
        try {
            d = sdf.parse(date);
        } catch (ParseException e) {
            Log.d(LOG,e.getMessage());
        }
        return  d;
    }
}
